Dynomotion

Group: DynoMotion Message: 1402 From: barry.graham911 Date: 7/2/2011
Subject: Problems with Backlash
I have just installed a kflop card on a RF40 Style Mill Drill retrofitted with Stepper Motors and linear glass scales.

I was previously driving directly the system using Mach3 - but the backlash and the lack of ability to utilise position feedback within Mach3 led me to try the dynomotion card.

I'm having the devil of a job tuning the stepper motors ! I have spent many hours playing with different settings.

The X axis is tolerable when using the linear backlash compensation along with a small amount of Integral.

The Y axis on the Mill has an adjustment on the leadscrew nut to tighten up the back lash but it is nigh on impossible to get to the screw ! Furthermore - I find that at differing points on the leadscrew - the amount of backlash is different - thus a fixed backlash setting is just confusing the system. I also tried without backlash compensation - but even with lots of feedforward and integral - the system cannot deal with nearly 0.15mm of no motion where there is commanded motion when changing directions.

Now I know that what I should have done is fitted decent leadscrews when I upgrade the mill (and this I will probably do eventually).

What I'm looking for is 2 fold - one is to advise tuning parameters that maybe I haven't tried or suggestion of how best to set up the motors ?

The other question is whether there's a software solution ? Would it not be possible to trap incoming move requests from Mach3 and if they involve a change of direction - rotate the drive until motion is detected using the linear scale feedback, and then proceed with the move (minus one step perhaps - which represents the initially detected motion) ? I guess this may not be so easy if move requests are buffered ? Or would it be possible to do it in the kflop drive level operating system - i.e do a small move whilst looking for signs of physical movement prior to executing the move command with whatever PID settings have been issued ?
Group: DynoMotion Message: 1403 From: Bengt Sjoelund Date: 7/2/2011
Subject: Re: Problems with Backlash
Hi Barry,
Only solution is to fix this mechanically will save you from headbanging.
Cheers
Bengt

--- In DynoMotion@yahoogroups.com, "barry.graham911" <barry.graham911@...> wrote:
>
> I have just installed a kflop card on a RF40 Style Mill Drill retrofitted with Stepper Motors and linear glass scales.
>
> I was previously driving directly the system using Mach3 - but the backlash and the lack of ability to utilise position feedback within Mach3 led me to try the dynomotion card.
>
> I'm having the devil of a job tuning the stepper motors ! I have spent many hours playing with different settings.
>
> The X axis is tolerable when using the linear backlash compensation along with a small amount of Integral.
>
> The Y axis on the Mill has an adjustment on the leadscrew nut to tighten up the back lash but it is nigh on impossible to get to the screw ! Furthermore - I find that at differing points on the leadscrew - the amount of backlash is different - thus a fixed backlash setting is just confusing the system. I also tried without backlash compensation - but even with lots of feedforward and integral - the system cannot deal with nearly 0.15mm of no motion where there is commanded motion when changing directions.
>
> Now I know that what I should have done is fitted decent leadscrews when I upgrade the mill (and this I will probably do eventually).
>
> What I'm looking for is 2 fold - one is to advise tuning parameters that maybe I haven't tried or suggestion of how best to set up the motors ?
>
> The other question is whether there's a software solution ? Would it not be possible to trap incoming move requests from Mach3 and if they involve a change of direction - rotate the drive until motion is detected using the linear scale feedback, and then proceed with the move (minus one step perhaps - which represents the initially detected motion) ? I guess this may not be so easy if move requests are buffered ? Or would it be possible to do it in the kflop drive level operating system - i.e do a small move whilst looking for signs of physical movement prior to executing the move command with whatever PID settings have been issued ?
>
Group: DynoMotion Message: 1406 From: Tom Kerekes Date: 7/2/2011
Subject: Re: Problems with Backlash
Hi Barry,
 
Well the only thing worse than lots of backlash is backlash that varies.
 
But here are some thoughts:
 
I assume you are running "Closed Loop Stepper" mode?
 
I don't think Velocity or Acceleration Feed Forward makes sense in this configuration so please set that to zero.
 
With closed loop and with backlash that varies I don't think Backlash compensation would be helpful so turn that off.
 
Ideally Closed Loop with glass scale feedback will do what you are requesting and eliminate errors and backlash, but the issue is with the complex dynamics of how it is corrected.
 
Have you made plots to observe exactly what is happening?  Using the Step Response Screen using "infinite" Jerk see if you can make plots (Command, Position Output vs Time) to clearly observe the issue.
 
The main problem with backlash in a feedback loop is that it is very destabilizing.  The worst situation is a system with backlash and a lot of static friction.  The servo ramps up motor torque and initially nothing happens due to friction, eventually torque overcomes friction and the motor begins to accelerate, but there is no information that the motor is accelerating fed back from the glass scales because of backlash.  Eventually the backlash is taken out and the scales detect a jump in velocity, but it might be too late at that point to avoid an overshoot.  Incidentally unlike static friction, Viscus friction (drag proportional to velocity) can help stabilize the system. 
 
Traditional servos minimize this problem by providing tachometer feedback from the motor shaft.  This basically allows information of when the motor shaft breaks free of friction and instead of uncontrolled acceleration through the backlash, there will be controlled velocity through the backlash until the scales detect motion and the error begins to decrease.  To some degree stepper motors provide a similar effect.  Steps to the Amplifier initially generate torque but no motion.  After static friction breaks free the motion reduces the torque.
 
We normally recommend using Integral Gain with a low pass filter when operating closed loop steppers.  Pure integral Gain will cause the output (position) to ramp at a rate proportional to the error.  As you increase the I gain and also as you increase the low pass frequency the errors and backlash should be eliminated faster.  However increasing them too much will cause overshooting and oscillation due to the effects described above.  Have you observed this?
 
Another important parameter is Max Error.   Normally with Integral feedback the step rate to correct error will increase proportionally with the size of the error.  Max Error can place a limit on the size of the error that the servo sees to effectively place a limit on the max rate that is ever used to correct error.  For large errors the servo will then step at a constant rate until the error becomes less than the Max Error setting, then slow down as the error decreases.  See:
 
 
Sorry for the long-winded response.  Closed loop with backlash is a very difficult and complex problem.   It would be interesting to see some of your plots.
 
Regards
TK
 
 
  
 
 
 


--- On Sat, 7/2/11, barry.graham911 <barry.graham911@...> wrote:

From: barry.graham911 <barry.graham911@...>
Subject: [DynoMotion] Problems with Backlash
To: DynoMotion@yahoogroups.com
Date: Saturday, July 2, 2011, 6:27 AM

 
I have just installed a kflop card on a RF40 Style Mill Drill retrofitted with Stepper Motors and linear glass scales.

I was previously driving directly the system using Mach3 - but the backlash and the lack of ability to utilise position feedback within Mach3 led me to try the dynomotion card.

I'm having the devil of a job tuning the stepper motors ! I have spent many hours playing with different settings.

The X axis is tolerable when using the linear backlash compensation along with a small amount of Integral.

The Y axis on the Mill has an adjustment on the leadscrew nut to tighten up the back lash but it is nigh on impossible to get to the screw ! Furthermore - I find that at differing points on the leadscrew - the amount of backlash is different - thus a fixed backlash setting is just confusing the system. I also tried without backlash compensation - but even with lots of feedforward and integral - the system cannot deal with nearly 0.15mm of no motion where there is commanded motion when changing directions.

Now I know that what I should have done is fitted decent leadscrews when I upgrade the mill (and this I will probably do eventually).

What I'm looking for is 2 fold - one is to advise tuning parameters that maybe I haven't tried or suggestion of how best to set up the motors ?

The other question is whether there's a software solution ? Would it not be possible to trap incoming move requests from Mach3 and if they involve a change of direction - rotate the drive until motion is detected using the linear scale feedback, and then proceed with the move (minus one step perhaps - which represents the initially detected motion) ? I guess this may not be so easy if move requests are buffered ? Or would it be possible to do it in the kflop drive level operating system - i.e do a small move whilst looking for signs of physical movement prior to executing the move command with whatever PID settings have been issued ?

Group: DynoMotion Message: 1412 From: Barry Graham Date: 7/3/2011
Subject: Re: Problems with Backlash
Tom
 
Thanks for the input.
 
I'll give it a try and send you some screen shots.
 
I was primarily using the move, rather than the infinite setp,  in the step response screen. Part of the problem in the move mode (I think) - is that the Stepping motors are quite slow (I struggle to get more than 180mm/minute under no load without dropping steps - I don't know whether this is cheap chinese motors, or stepper drivers, or both ! - The motors are possibly oversized for the rig - being NEMA 34 1600oz/in units). The number of microsteps per mechanical step is configurable in the stepper driver module - currently I'm running 2 steps to each graduation on the linear scales (i.e the motor moves the axis 0.0025mm per microstep, and the linear scale resolution if 0.005 mm, that equates to 5 microsteps per mechanical step). I'm wondering whether increasing (or decreasing) the number of microsteps per scale step might help ? Just trying to minimise the number of variables that I'm playing with !
 
Going back to the slowness - it is difficult to get much of a move on when you only have 3.5 seconds of sample time and slow motors. Thus I was finding that a good proportion of the total planned move was backlash - and thus there seemed to be insufficient steps for the PID controller to make corrections.
 
I did have some success without backlash compensation on the X Axis (which is definitely less sloppy than the Y axis) - but what I generally found is that the amount of 'correction' going on made the motor sound awfull !! I suspect that this would also lead to a rubbish surface finish if I ever get around to cutting any metal with this rig !
 
The other thing that I  found was that the Y axis (in particular) was tripping the soft reset in Mach 3 when executing some trial moves (I though that this was due to the error margin being exceeded ? Hard to see how that could have happened with the slack settings that I had - but it did occur quite a few times).
 
One good thing (Even with the dubious tuning that I have at the moment, and the backlash) - the X Axis would move and return to the same point over many cycles of +/- 10mm (running G code in Mach 3) so the position feedback is helping !
 

Group: DynoMotion Message: 1413 From: Tom Kerekes Date: 7/3/2011
Subject: Re: Problems with Backlash
Hi Barry,
 
On the Step Response Screen you were correct in using the "Move" button rather than the "Step" button.  The Step button is mainly useful for servo systems not Steppers.  I was referring to the Jerk parameter setting should be set very high (100X or more) of the Acceleration value to simulate typical path motion in Mach3.  For example a straight path into an arc requires instantaneous application of acceleration (infinite Jerk) at the entry point into the arc.
 
Yes your system seems very slow.  If I did the math right you are only getting 240 full steps/second.  Typically even large stepper motors are able to get 5X that step rate.  A stall or mis-step at that speed is referred to as a low-band (speed) resonance problem.  Normally the Amplifier should be able to dampen that out.  Since you have encoders you would normally be able to see it in the Step Response plots.  Go at a speed where the system stalls and observe the position plot.  BTW you can left-click mouse drag to zoom in.  However with 0.15mm of backlash which I think comes out to 12 full motor steps the motor resonance probably wont be observable.  A step motor will stall at 2 full steps of error.
 
Increasing the number of microsteps beyond 5 may help slightly and there shouldn't be any disadvantage.  Going beyond about 10 is generally considered not to increase smoothness significantly.
 
I don't understand your comment about 3.5 seconds being too short to capture the backlash correction.  That should happen in 0.1 sec or less.
 
Regards
TK
 
 
  
 
 
 


--- On Sun, 7/3/11, Barry Graham <barry.graham911@...> wrote:
 

From: Barry Graham <barry.graham911@...>
Subject: Re: [DynoMotion] Problems with Backlash
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Date: Sunday, July 3, 2011, 2:46 AM

 
Tom
 
Thanks for the input.
 
I'll give it a try and send you some screen shots.
 
I was primarily using the move, rather than the infinite setp,  in the step response screen. Part of the problem in the move mode (I think) - is that the Stepping motors are quite slow (I struggle to get more than 180mm/minute under no load without dropping steps - I don't know whether this is cheap chinese motors, or stepper drivers, or both ! - The motors are possibly oversized for the rig - being NEMA 34 1600oz/in units). The number of microsteps per mechanical step is configurable in the stepper driver module - currently I'm running 2 steps to each graduation on the linear scales (i.e the motor moves the axis 0.0025mm per microstep, and the linear scale resolution if 0.005 mm, that equates to 5 microsteps per mechanical step). I'm wondering whether increasing (or decreasing) the number of microsteps per scale step might help ? Just trying to minimise the number of variables that I'm playing with !
 
Going back to the slowness - it is difficult to get much of a move on when you only have 3.5 seconds of sample time and slow motors. Thus I was finding that a good proportion of the total planned move was backlash - and thus there seemed to be insufficient steps for the PID controller to make corrections.
 
I did have some success without backlash compensation on the X Axis (which is definitely less sloppy than the Y axis) - but what I generally found is that the amount of 'correction' going on made the motor sound awfull !! I suspect that this would also lead to a rubbish surface finish if I ever get around to cutting any metal with this rig !
 
The other thing that I  found was that the Y axis (in particular) was tripping the soft reset in Mach 3 when executing some trial moves (I though that this was due to the error margin being exceeded ? Hard to see how that could have happened with the slack settings that I had - but it did occur quite a few times).
 
One good thing (Even with the dubious tuning that I have at the moment, and the backlash) - the X Axis would move and return to the same point over many cycles of +/- 10mm (running G code in Mach 3) so the position feedback is helping !